package com.fzg.common.demo.hutool;

import cn.hutool.core.img.ImgUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.crypto.SecureUtil;
import cn.hutool.crypto.digest.MD5;
import cn.hutool.crypto.symmetric.AES;
import cn.hutool.crypto.symmetric.DES;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import lombok.extern.slf4j.Slf4j;

/**
 * create by fzg
 * 2022/12/13 14:14
 */

@Slf4j
public class Demo08 {

    public static void main(String[] args) {
        ImgUtil.convert(FileUtil.file("C:\\Users\\Asus\\Pictures\\Saved Pictures\\scenery\\640.png"),FileUtil.file("C:\\Users\\Asus\\Desktop\\temp\\test.jpg"));

        ImgUtil.gray(FileUtil.file("C:\\Users\\Asus\\Pictures\\Saved Pictures\\scenery\\640.png"),FileUtil.file("C:\\Users\\Asus\\Desktop\\temp\\test1.jpg"));


        String html = "{\"name\":\"Something must have been changed since you leave\"}";
        JSONObject jsonObject = JSONUtil.parseObj(html);
        String name = jsonObject.getStr("name");
        log.info(name);


        log.info("#########################");
        String cewvewf = SecureUtil.md5("cewvewf");
        log.info(cewvewf);

        AES aes = SecureUtil.aes();
        log.info(aes.toString());

        DES des = SecureUtil.des();
        log.info(des.toString());

        MD5 md5 = SecureUtil.md5();
        log.info(md5.toString());

    }

}
